package com.example.lesson_10_25.mapper;
import com.example.lesson_10_25.pojo.User;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import org.springframework.stereotype.Repository;

import java.util.*;
@Mapper
@Repository
public interface UserMapper {
        List<User> selectByName(@Param("username") String username);

        User selectOneUserByName(@Param("username") String username);
        List<User> selectAllUser();
        void addUserAndRole(@Param("username") String username, @Param("role_name") String role);
        void addUser(@Param("username") String username,  @Param("password") String password,
                        @Param("email") String email,  @Param("role_name") String role);
        void deleteUser(@Param("username") String username);
        void resetUserPassword(@Param("username") String username, @Param("password") String password);
        void updateUserEmail(@Param("username") String username, @Param("email") String email);
        void updateUserPassword(@Param("username") String username, @Param("password") String password);
        void updateUserRole(@Param("username") String username, @Param("role") String role);



}
